{extend name="../../public/admin"}
{block name="title"}添加数据{/block}
{block name="css"}{/block}
{block name="body"}
<div class="container">
    <div style="height: 20px;"></div>
    <form action="{:url('index/add_dictionaries')}" method="post" id="form">
        <div class="form-group input-group bg-label">
            <label class="input-group-addon">编号</label>
            <input type="text" name="code" class="form-control" datatype="n2-10">
        </div>
        <div class="form-group input-group bg-label">
            <label class="input-group-addon">名称</label>
            <input type="text" name="name" class="form-control" datatype="s1-20">
        </div>
        <div class="form-group input-group bg-label">
            <label class="input-group-addon">备注</label>
            <input type="text" name="memo" class="form-control" datatype="s1-100">
        </div>
        <div class="form-group input-group bg-label">
            <label class="input-group-addon">用途</label>
            <input type="text" name="title" class="form-control" datatype="s1-100">
        </div>
        <div class="form-group text-center">
            <button class="btn btn-info">{:lang('立即添加')}</button>
        </div>
    </form>
</div>
{/block}
{block name="js"}
<link rel="stylesheet" href="__PUBLIC__/public/validform/style.css">
<script src="__PUBLIC__/public/validform/Validform_v5.3.2_min.js"></script>
<script>
    (()=>{
        $('#form').Validform({
            tiptype:4,
            ajaxPost:true,
            callback:function (da) {
                if(da == 1){
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }
                else{
                    layer.msg('添加失败',{icon:2});
                }
            }
        });
    })()
</script>
{/block}
